#include <stdio.h>
#include "sqlite3.h"
int main(void)
{
	sqlite3* db = 0;
	sqlite3_open("MyDB", &db); /* Open a database named MyDB */
	sqlite3_exec(db, "attach database MyDBExtn as DB1", 0, 0, 0);
	sqlite3_exec(db, "begin", 0, 0, 0);
	sqlite3_exec(db, "insert into Students values(2000)", 0, 0, 0);
	sqlite3_exec(db, "insert into Courses values('SQLite Database', 2000)", 0, 0, 0);
	sqlite3_exec(db, "commit", 0, 0, 0);
	sqlite3_close(db);
	return SQLITE_OK;
}

/**
The application opens the MyDB
database, and then attaches the MyDBExtn database to the current connection. MyDB needs to
have a Students(SID) table, and the MyDBExtn database needs a Courses(name, SID) table.
The application opens a transaction by executing the begin command, inserts one row in
Students and one in Courses inside the transaction, and finally commits the transaction by
executing the commit command.
*/